package stopList;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Scanner;

/**
 * Classe pour creer l'arraylist de stopListe
 * @author coralie
 *
 */
public class StopList {

	private ArrayList<String> stopListe ;
	
	public StopList(String filePath) {
		stopListe = new ArrayList<String>();
		Scanner scanner;
		
		try 
		{
			scanner = new Scanner(new FileReader(filePath));
			while(scanner.hasNextLine())
			{
				stopListe.add(scanner.next());
				scanner.nextLine();
			}
		} 
		catch (FileNotFoundException e) 
		{
			e.printStackTrace();
		}
	}
	
	
	public ArrayList<String> getStopListe() {
		return stopListe;
	}


	public static void main(String[] args) {
		StopList s = new StopList("ressources/stopliste.txt");
		
		for (int i = 0; i < s.stopListe.size(); i++) {
			System.out.println(s.stopListe.get(i));
		}
		
		if(s.stopListe.contains("a"))
			System.out.println("la stopliste contient le mot a");
	}
	
}
